Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

Similar documents
Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Experiment 3 3 Basic Input Output

16-Bit Intel Processor Architecture

EEM336 Microprocessors I. Data Movement Instructions

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

Intel 8086 MICROPROCESSOR ARCHITECTURE

8086 INTERNAL ARCHITECTURE

Intel 8086 MICROPROCESSOR. By Y V S Murthy

ADVANCE MICROPROCESSOR & INTERFACING

Hardware and Software Architecture. Chapter 2

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

Code segment Stack segment

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

Introduction to Microprocessor

Internal architecture of 8086

icroprocessor istory of Microprocessor ntel 8086:

Northern India Engineering College, Delhi (GGSIP University) PAPER I

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

Mr. Sapan Naik 1. Babu Madhav Institute of Information Technology, UTU

UNIT 2 PROCESSORS ORGANIZATION CONT.

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language

EC-333 Microprocessor and Interfacing Techniques

CC411: Introduction To Microprocessors

WINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor

9/25/ Software & Hardware Architecture

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

Computer Architecture and System Software Lecture 06: Assembly Language Programming

A Presentation created By Ramesh.K Press Ctrl+l for full screen view

Chapter 02: Computer Organization. Lesson 02: Functional units and components in a computer organization- Part 1: Processor

1. Introduction to Assembly Language

INTRODUCTION TO MICROPROCESSORS

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives

Architecture of 8086 Microprocessor

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

Addressing Modes on the x86

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Chapter Three Addressing Mode MOV AX, BX

ORG ; TWO. Assembly Language Programming

UNIT 1. Introduction to microprocessor. Block diagram of simple computer or microcomputer.

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

EEM336 Microprocessors I. The Microprocessor and Its Architecture

Chapter 2 COMPUTER SYSTEM HARDWARE

8086 Microprocessors & Peripherals

Intel 8086: Instruction Set

Babu Madhav Institute of Information Technology, UTU

CS401 Assembly Language Solved MCQS From Midterm Papers

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

EE2007 Microprocessor systems.

Computer Architecture 1 ح 303

CG2007 Microprocessor systems.

Description of the Simulator

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:


reply db y prompt db Enter your favourite colour:, 0 colour db 80 dup(?) i db 20 k db? num dw 4000 large dd 50000

db "Please enter up to 256 characters (press Enter Key to finish): ",0dh,0ah,'$'

3- ADDRESSING MODES in 8086: In this section we use the MOV instruction to describe the data-addressing modes. Figure 3-1 shows the MOV instruction.

Unit I Introduction. Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad , India.

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

SHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte.

Computer Architecture and System Software Lecture 07: Assembly Language Programming

Experiment 3. TITLE Optional: Write here the Title of your program.model SMALL This directive defines the memory model used in the program.

Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2

Week 2 The 80x86 Microprocessor Architecture

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

EC-333 Microprocessor and Interfacing Techniques

Experiment #5. Using BIOS Services and DOS functions Part 1: Text-based Graphics

Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee

Advanced Microprocessors

The Microprocessor and its Architecture

Chapter 3: Addressing Modes

BAHAR DÖNEMİ MİKROİŞLEMCİLER LAB3 FÖYÜ

Come and join us at WebLyceum

x86 Assembly Tutorial COS 318: Fall 2017

Module 3 Instruction Set Architecture (ISA)

CS401 - Computer Architecture and Assembly Language Programming Glossary By

if 2 16bit operands multiplied the result will be

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture

UNIVERSITY OF CALIFORNIA, RIVERSIDE

Computer Organization and Assembly Language CSC-210

Moodle WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics

Lecture 13: I/O I/O. Interrupts. How?

UNIT II OVERVIEW MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Introduction to 8086 microprocessors. Architecture of 8086 processors


Topic 2 :16 Bit Microprocessor: 8086 (24 Marks)

Arithmetic and Logic Instructions And Programs

Assembly Language: g Part III. First Semester 2013 Department of Computer Science Faculty of Science Chiang Mai University

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

Philadelphia University Student Name: Student Number:

CS-202 Microprocessor and Assembly Language

EC 333 Microprocessor and Interfacing Techniques (3+1)

THE UNIVERSITY OF TRINIDAD & TOBAGO

Assembly Language Each statement in an assembly language program consists of four parts or fields.

Chapter 4: Data Movement Instructions. 4 1 MOV Revisited

Transfer of Control. Lecture 10 JMP. JMP Formats. Jump Loop Homework 3 Outputting prompts Reading single characters

CS 16: Assembly Language Programming for the IBM PC and Compatibles

Transcription:

1) Input/output In computing, input/output or I/O, is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it. The term can also be used as part of an action; to "perform I/O" is to perform an input or output operation. I/O devices are used by a person (or other system) to communicate with a computer. For instance, a keyboard or a mouse may be an input device for a computer, while monitors and printers are considered output devices for a computer. Devices for communication between computers, such as modems and network cards, typically serve for both input and output. Figure(3): I/O units communication ~7~

Variables Syntax for a variable declaration: name DB value name DW value DB stays for Define Byte. DW stays for Define Word. name can be any letter or digit combination, though it should start with a letter. It s possible to declare unnamed variables by not specifying the name (this variable will have an address but no name). value can be any numeric value in any supported numbering system (hexadecimal, binary, or decimal), or? symbol for variables that are not initialized. EX: MOV AL, var1 MOV BX, var2 RET ; stop the program (end) Var1 DB 7 Var2 DW 1234h ~8~

Interrupts Interrupts can be seen as a number of functions. These functions make the programming much easier, instead of writing a code to print a character you can simply call the interrupt and it will do everything for you. There are also interrupt functions that work with disk drive and other hardware. We call such functions software interrupts. Interrupts are also triggered by different hardware, these are called hardware interrupts. Currently we are interested in software interrupts only. To make a software interrupt there is an INT instruction, it has very simple syntax: INT value Where value can be a number between 0 to 255 (or 0 to 0FFh), generally we will use hexadecimal numbers. Each interrupt may have sub-functions. To specify a sub-function AH register should be set before calling interrupt. Each interrupt may have up to 256 sub-functions (so we get 256 * 256 = 65536 functions). In general AH register is used, but sometimes other registers maybe in use. Generally other registers are used to pass parameters and data to sub-function. 1. INT 10h The following example uses INT 10h sub-function 0Eh to type a "Hello!" message. This functions displays a character on the screen, advancing the cursor and scrolling the screen as necessary. ~9~

ORG 100h MOV AH, 0Eh MOV AL, 'H' ; ASCII code: 72 INT 10h ; print it! MOV AL, 'e' ; ASCII code: 101 INT 10h ; print it! MOV AL, 'l' ; ASCII code: 108 INT 10h ; print it! MOV AL, 'l' ; ASCII code: 108 INT 10h ; print it! MOV AL, 'o' ; ASCII code: 111 INT 10h ; print it! MOV AL, '!' ; ASCII code: 33 INT 10h ; print it! RET ; returns to operating system. 2. INT 21h INT 21h use many sub-functions such as: 01h to read one value of character from keyboard 02h to write one character on the screen. Every sub-function value was include in AH register

EX1: INT 21h for 01h sub-function MOV AH, 01 Ret In this program, if we read a character key this character was display on the screen, otherwise 0 value was display on screen (such as F1, F4, etc. ) EX2: INT 21h for 02h sub-function Input: load 02 into AH register Load ASCII code into DL register Output: Copy ASCII code into AL register MOV AH, 02H MOV DL,? EX: MOV AH, 1 ; read a character MOV BL, AL MOV AH, 2 ; save input character into BL ; carriage return MOV DL, 0DH ~00~

MOV DL, 0AH ; line feed MOV AH, 2 ; display the character stored in BL MOV DL, BL MOV AH, 4CH ; return control to DOS.. EX: MOV ah, 1h ; int 21h ; keyboard input subprogram read character into al MOV dl, al ; copy character to dl MOV ah, 2h ; int 21h ; character output subprogram display character in dl

2) CPU:Bus Interface Unit and Execution Unit The internal function of 8086 processor are partitioned logically into processing units,bus Interface Unit(BIU) and Execution Unit (EU).general block diagram of 8086 processor is shown in figure (4). Figure (4): Bus Interface Unit(BIU) and Execution Unit (EU). Execution Unit (EU) : Execution unit receives program instruction codes and data from the BIU, executes them and stores The results in the general registers. It can also store the data in a memory location or send them to an I/O device by passing the data back to the BIU. This unit, EU,

has no connection with the system Buses. It receives and outputs all its data through BIU. Bus Interface Unit : As the EU has no connection with the system Busses, this job is done by BIU. BIU and EU are connected with an internal bus. BIU connects EU with the memory or I/O circuits. It is responsible for transmitting data, addresses and control signal on the busses. EU is used mainly to execute instructions. It contains a circuit called the arithmetic and logic unit (ALU). The data for operations are stored in circuit called Registers. The EU has eight registers for storing data; their names are AX, BX, CX, DX, SI, DI, BP, SP and FLAGS register. The EU accepts instructions and data that have been fetched by the BIU and then processes the information. Data processed by the EU can be transmitted to the memory or peripheral devices through the BIU. EU has no direct connection with the outside world and relies solely on the BIU to feed it with instruction and data. It is here that instructions are received, decoded, and executed from the instruction queue portion of BIU. The instructions are taken from the top of the instruction queue on the first-in, first-out, or FIFO, basis. ALU (Arithmetic & Logic Unit) : This unit can perform various arithmetic and logical operation, if required, based on the instruction to be executed. It can perform arithmetical operations, such as add, subtract, increment, decrement, convert byte/word and compare etc and logical operations, such as AND, OR, exclusive OR, shift/rotate and test etc.

Registers Registers are 8, 16, or 32-bit high speed storage locations directly inside the CPU, figure(5) designed to be accessed at much higher speed than conventional memory. The CPU has an internal data bus that is generally twice as wide as its external data bus. Figure(5): Registers 8086 blockdaigram

Figure(6): General Registers of 8086 MPU Index Registers 1. SP (Stack Pointer): This is stack pointer register pointing to program stack. It is used in conjunction with SS for accessing the stack segment. 2. BP (Base Pointer): This is base pointer register pointing to data in stack segment. Unlike SP, we can use BP to access data in the other segments. 3. SI (Source Index): This is source index register which is used to point to memory locations in the data segment addressed by DS. By incrementing the contents of SI one can easily access consecutive memory locations. 4. DI (Destination Index): This is destination index register performs the same function as SI. There is a class of instructions called string operations. Segment Registers : BIU has 4 segment busses, CS, DS, SS, ES. These all 4 segment registers holds the addresses of instructions and data in memory. These values are used by the processor to access memory locations. It also contains 1 pointer register IP. IP contains the address of the next instruction to execute by the EU.

1- CS (Code Segment): The code segment register holds the base location of all executable instructions (code) in a program. 2- DS (Data Segment): the data segment register is the default base location for variables. The CPU calculates their location using the segment value in DS. 3- SS (Stack Segment): the stack segment register contain the base location of the stack. 4- ES (Extra Segment): The extra segment register is an additional base location for memory variables. Status and Control register: 1- IP (Instruction Pointer): The instruction pointer register always contain the offset of the next instruction to be executed within the current code segment. The instruction pointer and the code segment register combine to form the complete address of the next instruction. 2- The Flag Register: is a special register with individual bit positions assigned to show the status of the CPU or the result of arithmetic operations. Figure(13) describe the 8086/8088 flags register: ~07~